import _taggedTemplateLiteral from "@babel/runtime/helpers/esm/taggedTemplateLiteral";

var _templateObject, _templateObject2;

import { css } from 'styled-components'; // form layout gutter

var vars = {
  '@screen-lg': '992',
  '@screen-md': '768',
  '@cpaas-gutter-grow': 4,
  '@cpaas-gutter': 16,

  /**
   * 字体
   */
  '@cpaas-font-size-title': 14,
  '@cpaas-font-size-normal': 12,
  // 颜色
  '@cpaas-tabs-tab-color': '#4c4c4c',

  /**
   * 色彩
   */
  // 主要颜色 用于导航栏按钮 或者 其他需要强调的 文字 按钮 操作等
  '@cpaas-primary-color': '#1e3255',
  // 次级主要颜色 用于页面内部的主要按钮等
  '@cpaas-primary-color-2': '#29bece',
  // 次级主要颜色 用于页面内部的主要按钮hover等
  '@cpaas-primary-color-2-hover': '#4fd2db',
  // 次要颜色 用于 icon 图表等
  '@cpaas-primary-color-3-blue': '#0687ff',
  '@cpaas-primary-color-3-purple': '#cb38ad',
  '@cpaas-primary-color-3-yellow': '#ffbc00',
  '@cpaas-primary-color-3-red': '#f02b2b',
  // 低频颜色
  '@cpaas-minor-color-blue': '#daedfe',
  '@cpaas-minor-color-purple': '#f8e1f3',
  '@cpaas-minor-color-yellow': '#fff6d9',
  '@cpaas-minor-color-red': '#fddfdf',
  // 背景色
  '@cpaas-bgc-color': '#b9d3ff',
  '@cpaas-bgc-color-light': '#eee',
  '@cpaas-bgc-color-lightest': '#f0f0f0',
  '@cpaas-bgc-color-dark': '#d5dae0',
  '@cpaas-simple-bgc-color': '#f4f6f8',
  // 标题颜色
  '@cpaas-title-second-color': '#6d7a80',
  // 主按钮颜色
  '@cpaas-primary-btn-hover-color': '#405477',
  // disabled color
  '@cpaas-color-disabled': '#ccc',
  '@cpaas-bgc-color-disabled': '#f5f5f5',
  // 表单相关
  '@form-item-has-error-color': '#f13131',
  // 表单相关
  '@cpaas-form-required-color': '#fffbdf',
  // 表格相关
  '@cpaas-form-disabled-label-color': '#666',
  '@cpaas-form-disabled-wrapper-color': '#333',
  // notification
  '@cpaas-notification-success-color': '#4aa44e',
  '@cpaas-notification-info-color': '#3689f7',
  '@cpaas-notification-warn-color': '#f6bd41',
  '@cpaas-notification-error-color': '#dd4037',
  // Tabs 相关
  // FIXME: 暂时不能覆盖父级元素的 border 因为 overflow: hidden 了
  '@cpaas-tabs-card-tab-padding': '9px 14px',
  '@cpaas-tabs-card-tab-active-padding': '9px 14px',
  // 所有的 z-index 必须在这里声明
  // 菜单的 z-index
  '@cpaas-layout-menu-z-index': 1100
};
vars['@cpaas-gutter-md'] = vars['@cpaas-gutter'] - vars['@cpaas-gutter-grow'];
vars['@cpaas-gutter-sm'] = vars['@cpaas-gutter-md'] - vars['@cpaas-gutter-grow'];
vars['@cpaas-gutter-xs'] = vars['@cpaas-gutter-sm'] - vars['@cpaas-gutter-grow'];
vars['@cpaas-gutter-lg'] = vars['@cpaas-gutter'] + vars['@cpaas-gutter-grow']; // 20px

vars['@cpaas-gutter-xl'] = vars['@cpaas-gutter-lg'] + vars['@cpaas-gutter-grow']; // 24px

vars['@cpaas-gutter-xxl'] = vars['@cpaas-gutter-xl'] + vars['@cpaas-gutter-grow']; // 28px

vars['@cpaas-gutter-form-search'] = vars['@cpaas-gutter-md']; // 12px

vars['@cpaas-gutter-form-edit'] = vars['@cpaas-gutter-xl']; // 24px
// block gutter

vars['@cpaas-gutter-block'] = vars['@cpaas-gutter-xl']; // 24px connect is small

vars['@cpaas-gutter-inline'] = vars['@cpaas-gutter']; // 16px connect is big

vars['@cpaas-gutter-bgc'] = '#b9d3ff';
vars['@cpaas-gutter-bgc-light-1'] = '#eee';
vars['@cpaas-gutter-bgc-light-2'] = '#f0f0f0'; // Input 颜色
// 水平

vars['@cpaas-tabs-line-vertical-tab-padding'] = "13px ".concat(vars['@cpaas-gutter'], "px");
vars['@cpaas-tabs-line-vertical-tab-margin'] = "0 ".concat(vars['@cpaas-gutter'], "px 0 0"); // 垂直

vars['@cpaas-tabs-line-horizontal-tab-padding'] = "10px ".concat(vars['@cpaas-gutter'], "px");
export { vars };
export function cpaasFontSize() {
  var size = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 12;
  return css(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n    font-size: ", "px;\n    line-height: ", "px;\n  "])), size, size + 8);
}
export function textOverflow() {
  return css(_templateObject2 || (_templateObject2 = _taggedTemplateLiteral(["\n    overflow: hidden;\n    text-overflow: ellipsis;\n    word-break: break-all;\n    white-space: nowrap;\n  "])));
}
export function hexToRgbaColor() {
  var color = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '#000000';
  var opacity = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1;

  if (color.indexOf('rgba') > -1) {
    return color;
  } else if (color.indexOf('rgb') > -1) {
    /rgb\((.+)\)/.exec(color);
    return "rgba(".concat(RegExp.$1, ", ").concat(opacity, ")");
  }

  var hex = color.slice(1);

  if (hex.length !== 3 && hex.length !== 6) {
    return 'rgba(0, 0, 0, 0)';
  }

  if (hex.length === 3) {
    return "rgba(".concat(parseInt(hex.slice(0, 1), 16), ", ").concat(parseInt(hex.slice(1, 2), 16), ", ").concat(parseInt(hex.slice(2, 3), 16), ", ").concat(opacity, ")");
  }

  var r = parseInt("0x".concat(hex.slice(0, 2)), 16);
  var g = parseInt("0x".concat(hex.slice(2, 4)), 16);
  var b = parseInt("0x".concat(hex.slice(4)), 16);
  return "rgba(".concat(r, ", ").concat(g, ", ").concat(b, ", ").concat(opacity, ")");
}